#ifndef QSETTINGMANAGER_H
#define QSETTINGMANAGER_H

#include "corelibglobal.h"

#include <QMap>
#include <QString>
#include <QVariant>
#include <QStringList>
#include <QRect>
#include <QPoint>
#include <QSize>

class CORELIB_EXPORT QSettingManager
{
public:
    void    set_value(const QString &name,const QVariant &value);
    QVariant get_value(const QString &name,const QVariant &def=QVariant());

    void    save();
    void    load();
protected:
    QString variant_to_string(const QVariant & value);
    QVariant string_to_variant(const QString & value);
    QStringList splitArgs(const QString &s, int idx);
    void unescaped_string(const QString &value,QByteArray &result);
    void escaped_string(const QByteArray &array, QString &result);
protected:
    QMap<QString,QVariant>           m_settings;
};

#endif // QSETTINGMANAGER_H
